
#ifndef UTILS_HPP_
#define UTILS_HPP_

#include "cv.h"
#include "Parabola.hpp"
#include <stdio.h>
#include <iostream>

using namespace std;

class Utils {

public:
	Utils();
	virtual ~Utils();

	static void draw_grid( IplImage* img,int numOfHorizontalLinesInGrid, int numOfVerticalLinesInGrid,CvRect& box);

	static void deformPic(IplImage* origImg,IplImage* destImg,CvRect box, int d, bool leftToRight, int interpolationMethod);

private:
	static void nearest(double oldXdouble,uchar* origData, uchar* destData, int i, int step, int j, int channels, int k );
	static void biLinear(double oldXdouble,uchar* origData, uchar* destData, int i, int step, int j, int channels, int k );
	static void biCubic(double oldXdouble,uchar* origData, uchar* destData, int i, int step, int j, int channels, int k );
	static double lagrangeInterpolatingPolynomial (double pos[], double val[], int degree, double desiredPos);
};

#endif /* UTILS_HPP_ */
